import { SerializeStream } from "../../Framework/Serialize/SerializeStream";
import { SIllustrateInfo } from "./SIllustrateInfo";
//class DictIllustrateInfoHelper
    
    export  class DictIllustrateInfoHelper
    {
       

        public static write(arg1: SerializeStream, arg2: Map<any, any> /* flash.utils.Dictionary */): void
        {
            var loc1=0;
            var loc2=null;
            var loc3=null;
            if (arg2 != null) 
            {
                loc1 = 0;
                var loc4=0;
                var loc5=arg2;
                for (loc2 in loc5) 
                {
                    ++loc1;
                }
                arg1.writeSize(loc1);
                loc4 = 0;
                loc5 = arg2;
                for (loc3 in loc5) 
                {
                    arg1.writeInt(int(loc3));
                    (arg2[loc3] as SIllustrateInfo).__write(arg1);
                }
            }
            else 
            {
                arg1.writeSize(0);
            }
            return;
        }

        public static read(arg1: SerializeStream): Map<any, any> /* flash.utils.Dictionary */
        {
            var loc4=0;
            var loc5=null;
            var loc1=new Map<any, any> /* flash.utils.Dictionary */();
            var loc2=arg1.readSize();
            var loc3=0;
            while (loc3 < loc2) 
            {
                loc4 = arg1.readInt();
                (loc5 = new SIllustrateInfo()).__read(arg1);
                loc1[loc4] = loc5;
                ++loc3;
            }
            return loc1;
        }
    }
